package com.yidu.logisticssystem.utils;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

/**
 * <p>@Description: 工具</p>
 * <p>@author yidu-yuxigan</p>
 * <p>@Date:2021/1/13</p>
 * <p>@Time:10:25</p>
 */
public class BaseMessage {
    private Integer state; //状态0 失败    1 成功
    private String message; //文字信息
    private Object data; //数据

    public static BaseMessage succes(){
        BaseMessage bm=new BaseMessage();
        bm.setState(1);
        bm.setMessage("操作成功");
        return bm;
    }
    public static BaseMessage succes(Object date){
        BaseMessage bm=new BaseMessage();
        bm.setState(1);
        bm.setData(date);
        bm.setMessage("操作成功");
        return bm;
    }
    public static BaseMessage fail(){
        BaseMessage bm=new BaseMessage();
        bm.setState(0);
        bm.setMessage("操作失败");
        return bm;
    }
 

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
